package school.main;

import java.util.HashMap;
import java.util.List;

import school.dao.SchoolDAO;
import school.domain.School;

public class SchoolTest {
	public static void main(String[] args) {
		SchoolDAO dao = SchoolDAO.getInstance();
		
		//insert test
//		School sch1 = new School(1,"청명고등학교","경기도 수원시","1231234","국화",1243);
//		School sch2 = new School(2,"영덕고등학교","경기도 팔달구","1432531","장미",65434);
//		School sch3 = new School(3,"창원고등학교","경기도 매탄동","52345234","백합",123);
//		School sch4 = new School(4,"경기고등학교","경기도 흥덕지구","52345234","진달래",243);
//		School sch5 = new School(5,"성남고등학교","경기도 영통동","1215321","달기꽃",12213);
//		School sch6 = new School(6,"서울고등학교","경기도 매교동","123217882","안개꽃",92812);
//		School sch7 = new School(7,"광주고등학교","경기도 상지동","8397982","무궁화",139201);
//		School sch8 = new School(8,"부산고등학교","서울시 강남구","32178492","야생화",123);
//		School sch9 = new School(9,"한성고등학교","서울시 강서구","38972112","들국화",721);
//		School sch10 = new School(10,"경기대학교","서울시 영등포구","80379821","들장미",3787);
//		School sch11 = new School(11,"서울대학교","서울시 온수동","3927712","백장미",912);
//		School sch12 = new School(12,"성남대학교","경기도 구로구","238047891","데이지",8381);
//		School sch13 = new School(13,"청명중학교","광주시 명동","39278123","국화",321);
//		School sch14 = new School(14,"강남중학교","제주시 서귀포구","37891782","사쿠라",138);
//		School sch15 = new School(15,"수원중학교","서울시 종로구","39677212","라일락",857212);
//		School sch16 = new School(16,"판교대학교","강원도 강릉","8297809832","할매꽃",14);
//		dao.insertSchool(sch1);
//		dao.insertSchool(sch2);
//		dao.insertSchool(sch3);
//		dao.insertSchool(sch4);
//		dao.insertSchool(sch5);
//		dao.insertSchool(sch6);
//		dao.insertSchool(sch7);
//		dao.insertSchool(sch8);
//		dao.insertSchool(sch9);
//		dao.insertSchool(sch10);
//		dao.insertSchool(sch11);
//		dao.insertSchool(sch12);
//		dao.insertSchool(sch13);
//		dao.insertSchool(sch14);
//		dao.insertSchool(sch15);
//		dao.insertSchool(sch16);
		
		//selectone test
		System.out.println("======selectSchoolById TEST=======");
		School s1 = dao.selectSchoolById(10);
		System.out.println(s1);
		
		System.out.println("======updateSchool TEST=======");
		int up = dao.updateSchool(new School(16,"판교전문대","강원도 원주시","8297809832","할매꽃",12));
		System.out.println(up);
		
		System.out.println("======deleteSchoolById TEST=======");
		int up2 = dao.deleteSchoolById(12);
		System.out.println(up2);
		
		System.out.println("======selectSchool TEST=======");
		List<School> list = dao.selectSchoolList();
		for(School s:list){
			System.out.println(s);
		}
		System.out.println("======selectSchoolByAddress TEST=======");
		List<School> list2 = dao.selectSchoolByAddress("경기");
		for(School s:list2){
			System.out.println(s);
		}
		System.out.println("======selectSchoolByEnrollmentRange TEST=======");
		List<School> list3 = dao.selectSchoolByEnrollmentRange(100, 3000);
		for(School s:list3){
			System.out.println(s);
		}
	}
}
